import React, { PureComponent } from 'react';
import _ from 'lodash';
import { CardC } from '../../../../comps';
import { connect } from 'dva';
import myStyle from './myStyle.less';
import icon1 from '../../../../assets/busi/PortfolioManagement/portfolioDefinition/icon1.png';
import icon2 from '../../../../assets/busi/PortfolioManagement/portfolioDefinition/icon2.png';
import icon3 from '../../../../assets/busi/PortfolioManagement/portfolioDefinition/icon3.png';

@connect(({ TradeAnalysisNewM }) => ({ TradeAnalysisNewM }))
export default class PermissionProductCardC extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {};
  }
  componentDidMount() {}
  UNSAFE_componentWillReceiveProps(nextProps) {}

  render() {
    const { productData } = this.props;
    const topDiv = () => {
      return (
        <div className={myStyle.cardHead} title={productData.portfolioName}>
          {productData.portfolioName ? productData.portfolioName : ''}
        </div>
      );
    };
    const content = () => {
      return (
        <div className={myStyle.cardBody}>
          {/* 组合代码 */}
          <div className={myStyle.bodyLeft}>
            <p className={myStyle.portSpan} title={productData.portfolioCode ? productData.portfolioCode : ''}>
              {productData.portfolioCode ? productData.portfolioCode : ''}
            </p>
          </div>
          {/* 状态 */}
          <div className={myStyle.bodyRight}>
            <div className={myStyle.bodyItem}>
              <img className={myStyle.icon} src={icon1}></img>
              <span className={myStyle.itemtext}>{productData.status}</span>
            </div>

            {productData.isInvestment == 1 ? (
              <div className={myStyle.bodyItem} style={{ paddingTop: '20px' }}>
                <img className={myStyle.icon} src={icon2}></img>
                <span className={myStyle.itemtext}>投顾</span>
              </div>
            ) : null}

            {productData.isExtra == 1 ? (
              <div className={myStyle.bodyItem} style={{ paddingTop: '20px' }}>
                <img className={myStyle.icon} src={icon3}></img>
                <span className={myStyle.itemtext}>外部通道</span>
              </div>
            ) : null}
          </div>
        </div>
      );
    };
    return (
      <CardC
        cardId={productData.id}
        Top={topDiv()}
        Content={content()}
        // style={{float:'left',marginRight:'20px',marginBottom:'20px'}}
        width='317px'
      />
    );
  }
}
